$(document).ready(function(){
	//*****************选择挂号
	function change() {
				var Dvalue = $("#day").val()
				var yugi = function(n) {
					var now = new Date;
					now.setDate(now.getDate() + 7 - n);
					return now;
				}
				var date=yugi(Dvalue)
				var mon=date.getMonth()+1
				$("#data")
				.html("挂号日期："+date.getFullYear()+"-"+mon+"-"+date.getDate())
				.css("color","black")
			}
	
	          var date = new Date;
				var mon=date.getMonth()+1
				var day=date.getDate()+1
				$("#data").html("挂号日期："+date.getFullYear()+"-"+mon+"-"+day)
				
				function check(){
				
				var textareas=$("#ills").val()
				if(textareas.length>19){
					$("#sure").attr("type","submit")
				}
				else{
					$("#data")
					.html("请认真填写好主要病症")
					.css("color","red")
				}
			}
	
	
	function clearn(){
				change()
			}
	
	
	//**********************修改密码
			var oddpasslabel = $("#oldpasslabel")
			var newpasslabel = $("#newpasslabel")
			var snewpasslabel = $("#snewpasslabel")

			$("#sure").click(function(){
				
				var oddpass = $("#oldpass").val();
				var newpass = $("#newpass").val();
				var snewpass = $("#snewpass").val();
				if (oddpass == "" || newpass == "" || snewpass == "") {
					
					oddpasslabel.html("原密码：请输入完整")
					.css("color","red")
				}
				else{
					if (newpass != snewpass) {
					newpasslabel
					.html("新密码：请确保两次密码相同")
					.css("color","red")
					snewpasslabel.html("再次输入：请确保两次密码相同")
					.css("color","red")
				}
				else{
					$("#sure").attr("type","submit");
				}
				}
				
				
			    
			})
			
			
			$("input").click(function() {
				oddpasslabel.html("原密码：").css("color","black")
				newpasslabel.html("新密码：").css("color","black")
				snewpasslabel.html("再次输入：").css("color","black")
			})
		})